#!/usr/bin/env python
#-------------------------------------------------------------------------------
#   file menu_2.py
#   brief
#       ZetCode wxPython tutorial
#
#       In this example, we manually create a menu entry.
#
#       author: Jan Bodnar
#       website: www.zetcode.com
#       last modified: September 2011
#
#   $Id: $
#-------------------------------------------------------------------------------
# -*- coding: utf-8 -*-
import wx

APP_EXIT = 1

class Example(wx.Frame):
    
    def __init__(self, *args, **kwargs):
        super(Example, self).__init__(*args, **kwargs) 
        self.InitUI()
        
    def InitUI(self):
        menubar = wx.MenuBar()
        fileMenu = wx.Menu()
        qmi = wx.MenuItem(fileMenu, APP_EXIT, '&Quit\tCtrl+Q')
        qmi.SetBitmap(wx.Bitmap('icons/app-exit.png'))
        fileMenu.AppendItem(qmi)

        self.Bind(wx.EVT_MENU, self.OnQuit, id=APP_EXIT)

        menubar.Append(fileMenu, '&File')
        self.SetMenuBar(menubar)

        self.SetSize((325, 200))
        self.SetTitle('Icons and shortcuts')
        self.Centre()
        self.Show(True)
        
    def OnQuit(self, e):
        self.Close()

#-------------------------------------------------------------------------------
#   Main entry point
#   - Init the application
#   - Run the main loop
#-------------------------------------------------------------------------------
def main():
    ex = wx.App()
    Example(None)
    ex.MainLoop()    


#-------------------------------------------------------------------------------
#   Run main (if main)
#-------------------------------------------------------------------------------
if __name__ == '__main__':
    main()

#
#   End: menu_2.py
#
